-- GENERATED SPELL FOR [Illidari Nightlord] --


function spell0_22855(pUnit, Event) --@Curse of Mending,n/a--
pUnit:FullCastSpellOnTarget(39647,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22855', 2000, 1)
end

function spell1_22855(pUnit, Event) --@Fear,n/a--
pUnit:FullCastSpellOnTarget(41150,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22855', 4000, 1)
end

function spell2_22855(pUnit, Event) --@Shadow Inferno,Self--
pUnit:FullCastSpellOnTarget(39645,pUnit)
pUnit:RegisterEvent('Sorts_22855', 8000, 1)
end

function spell3_22855(pUnit, Event) --@Summon Shadowfiends,Self--
pUnit:FullCastSpellOnTarget(39649,pUnit)
pUnit:RegisterEvent('Sorts_22855', 610, 1)
end

function Sorts_22855(pUnit, Event)
local choix_sorts_22855 = math.random(0, 3)
if choix_sorts_22855 == 0 then
pUnit:RegisterEvent('spell0_22855', 1, 1)
end
if choix_sorts_22855 == 1 then
pUnit:RegisterEvent('spell1_22855', 1, 1)
end
if choix_sorts_22855 == 2 then
pUnit:RegisterEvent('spell2_22855', 1, 1)
end
if choix_sorts_22855 == 3 then
pUnit:RegisterEvent('spell3_22855', 1, 1)
end
end

function mob22855_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_22855', math.random(1500, 3000), 1)
end

function mob22855_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22855_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22855_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(22855, 1, 'mob22855_Action')
RegisterUnitEvent(22855, 2, 'mob22855_Leave')
RegisterUnitEvent(22855, 3, 'mob22855_Kill')
RegisterUnitEvent(22855, 4, 'mob22855_Die')
